﻿ function ViewsMenu_onItemSelect(sender, eventArgs)
        {
          var menuItem = eventArgs.get_item();
          var menuItemImage = menuItem.getProperty('Look-LeftIconUrl');
          var newToolBarItemImage = 'views_' + menuItemImage;
          var toolBarItem = ToolBar1.get_items().getItemById('ViewsItem');
          if (toolBarItem.get_imageUrl() != newToolBarItemImage)
          {
            ToolBar1.beginUpdate();
            toolBarItem.set_imageUrl(newToolBarItemImage);
            toolBarItem.set_hoverImageUrl('hover_' + newToolBarItemImage);
            toolBarItem.set_value(menuItem.get_text());
            ToolBar1.endUpdate();
          }
        }

        function OrganizeMenu_onItemSelect(sender, eventArgs)
        {
          var selectedItem = eventArgs.get_item();
          if(selectedItem.get_text()=="Exit")
           {
                var r=confirm("Çıkmak İstediğinize Emin misiniz?")
                if(r==true)
                    window.close();
           }
           else if(selectedItem.get_text()=="Yeni Müşteri")
           {
                window.open('Customer.aspx','_blank','width=700,height=650,scrollbars=1');
           }
        }

        function ToolBar1_onItemSelect(sender, eventArgs)
        {
          var selectedItem = eventArgs.get_item();
          displaySelectedItem(selectedItem.get_value());
        }

        function displaySelectedItem(message)
        {
          document.getElementById('selectedItem').innerHTML = message;
        }
        
        function get_png_image(img) { return img.replace("gif","png"); }

        function get_group_text(idx) { return Grid1.get_table().get_columns()[idx].get_headingText(); }
        
        function ReKey(targetTextBox,content)
        {
           window.close();
           window.opener.document.getElementById(targetTextBox).value=content.value;
        }
        function ReKeyStok(content)
        {
           window.close();
           window.opener.location="Stok.aspx?id="+content.value;
        }
       
        function openpage(targetTextBox) 
        {
            var newwin=window.open('CrmList.aspx?'+targetTextBox+'',"CrmList","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,top=100,left=200,width=580,height=500");
            newwin.focus();
            return false;
        }
        function OpenPageStok(targetPage)
        {
            var newwin=window.open('CrmList.aspx?'+targetPage+'',"CrmList","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,top=100,left=200,width=580,height=500");
            newwin.focus();
        }
        function BtnGiris(myform)
        {
        if(window.event.keyCode==13)
        {
        var id=document.getElementById(myform);
           id.focus();
        }
        }
        function CancelButton()
        {
        window.close();
        }
   
        
 

